package com.example.mydy.model;

/**
 * 下级收益记录类，扩展了普通收益记录
 */
public class DownlineIncomeRecord extends IncomeRecord {
    private int level; // 下级级别：1表示一级下线，2表示二级下线，3表示三级下线
    private String downlineUsername; // 下级用户名
    private String downlineNickname; // 下级昵称

    public DownlineIncomeRecord(String id, double amount, String description, String downlineUsername, long timestamp, String status) {
        super(id, amount, "downline", description, timestamp, status);
        this.downlineUsername = downlineUsername;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getDownlineUsername() {
        return downlineUsername;
    }

    public void setDownlineUsername(String downlineUsername) {
        this.downlineUsername = downlineUsername;
    }

    public String getDownlineNickname() {
        return downlineNickname;
    }

    public void setDownlineNickname(String downlineNickname) {
        this.downlineNickname = downlineNickname;
    }
    
    /**
     * 获取级别的文本表示
     * @return 级别文本
     */
    public String getLevelText() {
        switch (level) {
            case 1:
                return "一级";
            case 2:
                return "二级";
            case 3:
                return "三级";
            default:
                return "未知";
        }
    }
} 